﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_logoff : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        if (LogIn() != 0)
        {
            
            Response.Redirect(Constant.ROOT_PATH + "admin/Default.aspx");
            
        }
        else { 
        }
    }

    private int LogIn() {
        String m_Uer = "";
        String m_pass = "1A2DDA13FD0BC4AB6B11BC5BD0186E3D";
        m_Uer = Login1.UserName;
        WebData db = new WebData();
        int i=db.tbl_Users.CheckLogin(m_Uer, m_pass);
        if (i != 0) {
            Session["username"] = Login1.UserName;
            Session["login"] = 1;
        }
        return i;

    }
}